/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.storage.entity;

import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 运费模板Entity
 */
@Table(name="biz_freight_tpl", alias="a", columns={
		@Column(name="id", attrName="id", label="唯一标识", isPK=true),
		@Column(name="brand_id", attrName="brandId", label="品牌id", isQuery=false),
		@Column(name="from", attrName="from", label="出发地", queryType=QueryType.LIKE),
		@Column(name="to", attrName="to", label="目的地", queryType=QueryType.LIKE),
		@Column(name="freight", attrName="freight", label="运费", isQuery=false),
		@Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false, isQuery=false),
		@Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false),
		@Column(name="update_by", attrName="updateBy", label="更新者", isQuery=false),
		@Column(name="update_date", attrName="updateDate", label="更新时间", isQuery=false),
	}, orderBy="a.update_date DESC"
)
public class FreightTpl extends DataEntity<FreightTpl> {
	
	private static final long serialVersionUID = 1L;
	private String brandId;		// 品牌id
	private String from;		// 出发地
	private String to;		// 目的地
	private Double freight;		// 运费
	
	public FreightTpl() {
		this(null);
	}

	public FreightTpl(String id){
		super(id);
	}
	
	@Length(min=0, max=64, message="品牌id长度不能超过 64 个字符")
	public String getBrandId() {
		return brandId;
	}

	public void setBrandId(String brandId) {
		this.brandId = brandId;
	}
	
	@Length(min=0, max=255, message="出发地长度不能超过 255 个字符")
	public String getFrom() {
		return from;
	}

	public void setFrom(String from) {
		this.from = from;
	}
	
	@Length(min=0, max=255, message="目的地长度不能超过 255 个字符")
	public String getTo() {
		return to;
	}

	public void setTo(String to) {
		this.to = to;
	}
	
	@NotNull(message="运费不能为空")
	public Double getFreight() {
		return freight;
	}

	public void setFreight(Double freight) {
		this.freight = freight;
	}
	
}